<?php
include_once "soar/web.inc";

function log_in_func()
{/*{{{*/
    return sprintf('%s|%s: log', basename(__FILE__), __FUNCTION__);
}/*}}}*/

class log
{/*{{{*/
    public static function in_class()
    {
        return sprintf('%s|%s: log', basename(__FILE__), __METHOD__);
    }
}/*}}}*/

function main(&$view)
{/*{{{*/
    $view=array();

    $msg='Hello, no.1 line';
    errlog::add($msg);
    $view[]=$msg;

    $msg='Hello, no.2 line';
    errlog::add($msg);
    $view[]=$msg;

    $num=100;
    errlog::add('%s L.%d: There are %d items',
            basename(__FILE__), __LINE__, $num);
    $msg=sprintf('%s L.%d: There are %d items',
            basename(__FILE__), __LINE__, $num);
    $view[]=$msg;

    $msg=log_in_func(); 
    $view[]=$msg;

    $msg=log::in_class();
    $view[]=$msg;
}/*}}}*/

main($VIEW);
?>
<html>
<body>
<?php
foreach($VIEW as $item)
{
    echo $item."<br/>\n";
}
?>
</body>
</html>
